﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        $('#myTab a:first').tab('show');

        if (!!keyValue) {
            $.najax({
                url: "/Staff/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });
    function initControl() {
        $("#Gender").bindSelect();
        //组织机构下拉框
        $("#OrganizeId").bindSelect({
            url: "/Organize/GetChildTreeSelectJson",
        });
        //组织对应的科室下拉框加载
        $("#OrganizeId").bind("change", function () {
            var organizeId = $(this).val();
            $("#DepartmentCode").bindSelect({
                url: "/Department/GetTreeSelectJson?organizeId=" + organizeId,
            });
        });
        $("#zc").bindSelect({
            url: "/ItemsData/GetSelectJson?code=DoctorTitle"
        });
    }
</script>
<form id="form1">
    <div class="container" style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <ul class="nav nav-tabs" role="tablist" id="myTab">
            <li role="presentation"><a href="#basicInfo" role="tab" data-toggle="tab">基本信息</a></li>
        </ul>
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade in active" style="padding-top: 20px; margin-right: 30px;" id="basicInfo">
                <table class="form">
                    <tr>
                        <th class="formTitle">机构：</th>
                        <td class="formValue">
                            <select id="OrganizeId" name="OrganizeId" class="form-control required">
                                <option value="">==请选择==</option>
                            </select>
                        </td>
                        <th class="formTitle">科室：</th>
                        <td class="formValue">
                            <select id="DepartmentCode" name="DepartmentCode" class="form-control required">
                                <option value="">==请选择==</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">姓名：</th>
                        <td class="formValue">
                            <input id="Name" name="Name" type="text" class="form-control required" placeholder="请输入姓名" />
                        </td>
                        <th class="formTitle">性别：</th>
                        <td class="formValue">
                            <select id="Gender" name="Gender" class="form-control required">
                                <option value="true">男</option>
                                <option value="false">女</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">工号：</th>
                        <td class="formValue">
                            <input id="gh" name="gh" type="text" class="form-control required" placeholder="请输入工号" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">职称：</th>
                        <td class="formValue">
                            <select id="zc" name="zc" class="form-control ">
                                <option value="">==请选择==</option>
                            </select>
                        </td>
                        <th class="formTitle">头像：</th>
                        <td class="formValue">
                            <input id="HeadIcon" name="HeadIcon" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">手机：</th>
                        <td class="formValue">
                            <input id="MobilePhone" name="MobilePhone" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">生日：</th>
                        <td class="formValue">
                            <input id="Birthday" name="Birthday" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">微信：</th>
                        <td class="formValue">
                            <input id="WeChat" name="WeChat" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">邮箱：</th>
                        <td class="formValue">
                            <input id="Email" name="Email" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">排序：</th>
                        <td class="formValue">
                            <input id="px" name="px" type="text" class="form-control" placeholder="" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" style="height: 35px;">选项：</th>
                        <td class="formValue" style="padding-top: 1px;">
                            <div class="ckbox">
                                <input id="zt" name="zt" type="checkbox" checked="checked"><label for="zt">有效</label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" valign="top" style="padding-top: 5px;">
                            备注：
                        </th>
                        <td class="formValue" colspan="3">
                            <textarea id="Description" name="Description" class="form-control" style="height: 60px;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">创建人员：</th>
                        <td class="formValue">
                            <input id="CreatorCode" name="CreatorCode" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">创建时间：</th>
                        <td class="formValue">
                            <input id="CreateTime" name="CreateTime" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">修改人员：</th>
                        <td class="formValue">
                            <input id="LastModifierCode" name="LastModifierCode" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">修改时间：</th>
                        <td class="formValue">
                            <input id="LastModifyTime" name="LastModifyTime" type="text" class="form-control" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</form>
